'''
Created on Mar 16, 2012

@author: phuongdongbk
'''
import math

n = int(raw_input("Nhap n:"))
def primes(n):
    i=2
    
    while(i<=n):
        prime = True
        for j in range (2,i):
            if i % j ==0:
                prime = False
                break
        if prime:
            yield i
        i = i+1

for i in range(2,n):
    if i in primes(n):
        print i,
    else:
        for j in primes(i):
            tmp = i
            while(tmp%j ==0):
                tmp = tmp / j
                if tmp ==1:
                    print i,
                
        
    